package com.wz.compilerManual.stacktest;

public class InnerStack {
    private InnerStack next;
    private SymbolContent top;

    public void setNext(InnerStack next) {
        this.next = next;
    }

    public InnerStack getNext() {
        return next;
    }

    public void push(SymbolContent symbolStack){
        symbolStack.setNext(top);
        top = symbolStack;
    }

    public SymbolContent peek(){
        return top;
    }

    public SymbolContent pop(){
        SymbolContent symbolStack = top;
        top = top.getNext();
        symbolStack.setNext(null);
        return symbolStack;
    }
}